package org.itboys.framework.rpc;

import com.google.common.collect.Maps;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by ChenJh
 */
@Service
public class LocalServletHolder implements RpcServletHolder {

    private long expireTime; //失效时间 单位 秒

    private static Map<String, Map<String, Object>> sessionMap = Maps.newConcurrentMap();

    private static Map<String, Long> expireTimeMap = Maps.newConcurrentMap();

    @Override
    public <T> boolean addToSession(HttpServletRequest request, HttpServletResponse response, String sessionKey, T value) {
        String sessionId = getSessionId(request);
        return false;
    }

    @Override
    public Object getValueFromSession(HttpServletRequest request, HttpServletResponse response, String sessionKey) {
        return null;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }
}
